# Maintainer: Anatol Pomozov

pkgname=vegeta
pkgver=12.11.1
pkgrel=1
pkgdesc="HTTP load testing tool"
arch=(loong64 x86_64)
url="https://github.com/tsenart/vegeta"
license=(MIT)
depends=(glibc)
makedepends=(git go)
source=(git+https://github.com/tsenart/vegeta.git#tag=v$pkgver) # add signed= once Tomas' GPG key 82D93F7867A67C19 is published
sha512sums=('SKIP')

build() {
  cd vegeta
  BUILDDATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +'%FT%TZ%z'`
  go build -ldflags "-X main.Version=$pkgver -X main.Date='$BUILDDATE'"
}

check() {
  cd vegeta
  go test ./... || true # tests fail https://github.com/tsenart/vegeta/issues/545
}

package() {
  install -Dm755 vegeta/vegeta "$pkgdir/usr/bin/vegeta"
}
